<?php namespace app\common\validate;


use think\Validate;

/**添加银行卡
 * Created by PhpStorm.
 * User: Administrator
 * Date: 2019/3/14
 * Time: 15:13
 */
class UserBank extends Validate {
    protected $rule = [
                    'compellation'  => 'require',
                    'banking_id'  => 'require',
                    'account'  => 'require',
                    'branch'  => 'require',
                    'mobile'   => 'require',
                    ];
    protected $message = [
                    'compellation.require' => '姓名不能为空',
                    'banking_id.require' => '请选择银行类型',
                    'account.require' => '账号不能为空',
                    'branch.require' => '支行不能为空',
                    'mobile.require' => '手机号不能为空',
                    ];
    // 自定义验证规则
    protected function checkName($value,$rule,$data)
    {
        return $rule == $value ? true : '名称错误';
    }
}